package com.bkgy.modular.ltTechnologyDetermine.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.ltTechnologyDetermine.service.TechnologyDetermineService;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author
 * @version 1.0
 * @ClassName TechnologyDetermineController
 * @date 2023/5/18 11:13
 */
@RestController
@RequestMapping("/technologyDetermine")
public class TechnologyDetermineController {
    @Resource
    private TechnologyDetermineService technologyDetermineService;

    @PostMapping("/findByData")
    public ResultData findByData(@RequestBody JSONObject jsonObject) {
        return technologyDetermineService.findByData(jsonObject);
    }

    @PostMapping("/findByDatapd")
    public ResultData findByDatapd(@RequestBody JSONObject jsonObject) {
        return technologyDetermineService.findByDatapd(jsonObject);
    }

    @PostMapping("/findByMongDbData")
    public ResultData findByMongDbData(@RequestBody JSONObject jsonObject) {
        return technologyDetermineService.findByMongDbData(jsonObject);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        technologyDetermineService.export(jsonObject,response);
    }
}
